package objects;

import org.newdawn.slick.Color;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.geom.Circle;

public class CircleSlider {
	public float x,y,r;
	Color activeColor,staticColor,edgeColor;
	boolean active=false;
	
	public CircleSlider(){
		x=0;	y=0;	r=10;
		activeColor=Color.green.darker();
		staticColor=Color.darkGray;
		edgeColor=Color.black;
	}
	public CircleSlider(float xin, float yin, float rin){
		x=xin;	y=yin;	r=rin;
		activeColor=Color.green.darker();
		staticColor=Color.darkGray;
		edgeColor=Color.black;
	}
	public CircleSlider(float xin, float yin, float rin, Color ac, Color sc, Color ec){
		x=xin;	y=yin;	r=rin;
		activeColor=ac;
		staticColor=sc;
		edgeColor=ec;
	}
	
	public void draw(Graphics g){
		g.setColor(edgeColor);
		g.draw(new Circle(x,y,r+3));
		
		g.setColor(staticColor);
		if(active){g.setColor(activeColor);}
		g.draw(new Circle(x,y,r));
	}
	public void update(float mouseX, float mouseY, boolean mouseClick){
		if(mouseClick){
			x=mouseX;	y=mouseY;	active=true;
		}
		else{
			active=false;
		}
	}
}